package model;

public class InnerResult {
    public enum Status {
        FULFILLED, REJECTED, ERROR
    }

    private Status status;
    private Object object;

    public InnerResult() {}

    public InnerResult(Status status) {
        this.status = status;
    }

    public InnerResult(Status status, Object object) {
        this.status = status;
        this.object = object;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public static InnerResult fulfill() {
        return new InnerResult(Status.FULFILLED);
    }

    public static InnerResult fulfill(Object object) {
        return new InnerResult(Status.FULFILLED, object);
    }

    public static InnerResult reject(Object object) {
        return new InnerResult(Status.REJECTED, object);
    }

}
